<template>
  <div class="navfooter">
    <div class="footer">
      <div
        class="footerItem"
        v-for="(item, index) in footerList"
        :key="index"
        @click="chooseItem(index)"
      >
        <div class="itembox" :class="[chooseIndex === index ? 'active' : '']">
          {{ item }}
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
let footerList = ['T2总览', '活动中心', '梯队党建']
let chooseIndex = ref(0)
const chooseItem = (index) => {
  chooseIndex.value = index
  switch (index) {
    case 0:
      router.push('secondoverview')
      break
    case 1:
      router.push('activitycenter')
      break
    case 2:
      router.push('echelonpartybuilding')
      break
  }
}
</script>
<style lang="scss" scoped>
.navfooter {
  width: 3840px;
  height: 117px;
  background: url('@/assets/images/global/footer.png') no-repeat;
  background-size: 100% 100%;
  position: fixed;
  z-index: 1;
  top: 895px;
  left: 0;
  .footer {
    height: 100%;
    text-align: center;
    width: 700px;
    margin: 0 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 34px;
    font-family: pmzd;
    font-weight: 400;
    font-style: italic;
    color: #abc9fc;
    text-shadow: 2px 2px 2px rgba(2, 45, 57, 0.34);
    .footerItem {
      width: 200px;
      cursor: pointer;
      .itembox {
        transform: translateY(-5px);
        &.active {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 231px;
          height: 160px;
          transform: translateY(-40px);
          font-size: 42px;
          color: #ffffff;
          text-shadow: 2px 3px 5px rgba(3, 24, 43, 0.83);
          background: url('@/assets/images/global/footeritem.png') no-repeat;
          background-size: 231px 160px;
        }
      }
    }
  }
}
</style>
